<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        var o1={
            name:"刘德华",
            age:20,
        }
        var o2={
            age:30,
            address:"中国"
        }
        // for(var key in o2){
        //     o1[key]=o2[key];
        // }
        // console.log(o1);
        // Object.assign(o1,o2);
        // console.log(o1);
        var o3=Object.assign({},o1,o2);
        console.log(o3);
        console.log(o1);
        console.log(o2);
    </script>
</body>
</html>